package org.zh.sh.util.http;


import java.lang.invoke.MethodHandle;
import java.lang.reflect.Type;
import java.util.Arrays;
import java.util.Objects;

public class PathBean {
    private String path;
    private String httpMethod;
    private Class<?> vllClass;
    private Type[] types;
    private MethodHandle methodHandle;
    private String produces;
    private String consumes;

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getHttpMethod() {
        return httpMethod;
    }

    public void setHttpMethod(String httpMethod) {
        this.httpMethod = httpMethod;
    }

    public Class<?> getVllClass() {
        return vllClass;
    }

    public void setVllClass(Class<?> vllClass) {
        this.vllClass = vllClass;
    }

    public Type[] getTypes() {
        return types;
    }

    public void setTypes(Type[] types) {
        this.types = types;
    }

    public MethodHandle getMethodHandle() {
        return methodHandle;
    }

    public void setMethodHandle(MethodHandle methodHandle) {
        this.methodHandle = methodHandle;
    }

    public String getProduces() {
        return produces;
    }

    public void setProduces(String produces) {
        this.produces = produces;
    }

    public String getConsumes() {
        return consumes;
    }

    public void setConsumes(String consumes) {
        this.consumes = consumes;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) return false;
        PathBean pathBean = (PathBean) o;
        return Objects.equals(path, pathBean.path) && Objects.equals(httpMethod, pathBean.httpMethod) && Objects.equals(vllClass, pathBean.vllClass) && Objects.deepEquals(types, pathBean.types) && Objects.equals(methodHandle, pathBean.methodHandle) && Objects.equals(produces, pathBean.produces) && Objects.equals(consumes, pathBean.consumes);
    }

    @Override
    public int hashCode() {
        return Objects.hash(path, httpMethod, vllClass, Arrays.hashCode(types), methodHandle, produces, consumes);
    }

    @Override
    public String toString() {
        return "PathBean{" +
               "path='" + path + '\'' +
               ", httpMethod='" + httpMethod + '\'' +
               ", vllClass=" + vllClass +
               ", types=" + Arrays.toString(types) +
               ", methodHandle=" + methodHandle +
               ", produces='" + produces + '\'' +
               ", consumes='" + consumes + '\'' +
               '}';
    }
}
